package com.pb.camera.adapter;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import com.pb.camera.R;
import com.pb.camera.constants.MyContants;

import android.content.Context;
import android.util.SparseArray;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class CamerInfoAdapter extends BaseAdapter{
	private List<String> mKeys;
	private List<String> mValues;
	private Context mContext;
	public CamerInfoAdapter(Context context,List values) {
		assert(context != null);
		this.mContext = context;
		this.mValues = values;
		this.mKeys = MyContants.getCamerInfoKeys(context);
	}
	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return mKeys.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		if (convertView == null){
			convertView = View.inflate(mContext, R.layout.item_camer_info, null);
		}
		TextView nameView = (TextView) convertView.findViewById(R.id.tv_info_name);
		TextView detailView = (TextView) convertView.findViewById(R.id.tv_info_detail);
		nameView.setText(mKeys.get(position));
		if (mValues.size() > position)
			detailView.setText(mValues.get(position));
		return convertView;
	}
}
